$(document).ready(function() { // Creating custom :external selector $.expr[':'].external = function(obj){ return !obj.href.match(/^mailto\:/) && obj.href!=null // This condition exists for onclick() calls - javascript && obj.href!='' && !obj.href.match(/^javascript/) && !obj.href.match(/^http\:\/\/entp.hud.gov/) && !obj.href.match(/^https\:\/\/entp.hud.gov/) && !obj.href.match(/^http\:\/\/blog.hud.gov/) && !obj.href.match(/^http\:\/\/hud.gov/) && !obj.href.match(/^http\:\/\/www.hud.gov/) && !obj.href.match(/^http\:\/\/www3.hud.gov/) && !obj.href.match(/^https\:\/\/www3.hud.gov/) && !obj.href.match(/^http\:\/\/www5.hud.gov/) && !obj.href.match(/^https\:\/\/www5.hud.gov/) && !obj.href.match(/^https\:\/\/www5.hud.gov/) && !obj.href.match(/^https\:\/\/hudapps.hud.gov/) && !obj.href.match(/^https\:\/\/pic.hud.gov/) && !obj.href.match(/^https\:\/\/webapps1.hud.gov/) && !obj.href.match(/^http\:\/\/lnshhq05w.hud.gov/) && !obj.href.match(/^http\:\/\/www.hudoig.gov/) && !obj.href.match(/^http\:\/\/ptp.hud.gov/) && !obj.href.match(/^http\:\/\/hwvauap407.hud.gov:8080/) && !obj.href.match(/^http\:\/\/*.hud.gov/) && !obj.href.match(/^http\:\/\/[^ ]*gov/) && !obj.href.match(/^https\:\/\/[^ ]*gov/) && (obj.hostname != location.hostname); }; // Add 'external' CSS class to all external links $('a:external').addClass('external'); $('.external').click(function() { var link = $(this).attr('href'); $('